<!DOCTYPE html>
<html>
<head>
    <meta name="layout" content="main" />
    <meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no">
    <g:set var="entityName" value="${message(code: 'estate.label', default: 'Estate')}" />
    <title>项目风险预警</title>
    <style>
    .contact-stat{
        padding: 8px 0px;
        text-align: center;
    }
    .contact-stat span{
        font-size: 13px;
        color: #88898c;
        margin-bottom: 10px;
    }
    .contact-stat strong{
        font-size: 13px;
        word-wrap: break-word;
    }
    .nav-tabs{
        border-bottom: none;
    }
    .hpanel > .panel-footer, .hpanel > .panel-section{
        background: #f9f9f9;
    }

    .newFontSize{
        font-size: 12px;
    }
    table>tbody>tr>td, table>tbody>tr>th,.table>tfoot>tr>td, table>tfoot>tr>th, table>thead>tr>td, table>thead>tr>th{
        padding: 8px;
        line-height: 1.42857143;
    }
    .tdColor{
        color: red !important;
    }

    </style>
</head>
<body class="fixed-navbar fixed-sidebar">

<div class="small-header">
    <div class="hpanel">
        <div class="panel-body">
            <div id="hbreadcrumb" class="pull-right">
                <ol class="hbreadcrumb breadcrumb">
                    <li>CINDATA PLS</li>
                    <li class="">
                        <span>开发商预警</span>
                    </li>
                    <li class="active">
                        <span>项目风险预警</span>
                    </li>
                </ol>
            </div>

            <h2 class="font-light m-b-xs">
                项目风险预警
            </h2>
        </div>
    </div>
</div>

<div class="content animate-panel">
    <div class="row">
        <g:form method="POST" action="riskWarningAccountProject" class="form-horizontal" role="form" id="form">
            <div class="hpanel hblue">
                <div class="panel-heading">
                    <div class="panel-tools">
                        <button class="btn btn-primary btn-xs" type="submit" id="searchBtn"><i class="fa fa-search"></i> 查询</button>
                        <button class="btn btn-warning2 btn-xs" type="button" id="resetBtn">
                            <i class="fa fa-times"></i> 重置</button>
                    </div>
                    查询
                </div>
                 <div class="panel-body seach-group" id="bug1">
                    <input type="text" class="form-control hide" name="warningType" id="warningType" value="${params?.warningType}">
            <div class="row">
                <div class="form-group col-sm-3">
                    <label for="city" class="col-sm-3 control-label">城市</label>
                    <div class="col-sm-9">
                        <g:select class="form-control" name="city" id="city" from="${com.cindata.City.findAllByNameInList(new com.cindata.ComponentService().evaluate(com.cindata.Component.findByCode('showCity')), [sort: 'name', order: 'asc'])}"
                                  valueMessagePrefix="status" optionKey="zoneNumber" optionValue="name"
                                  value="${params?.city}"
                                  noSelection="${["-1": '请选择城市']}"/>
                    </div>
                </div>
                <div class="form-group col-sm-3">
                    <label for="district" class="col-sm-3 control-label">行政区</label>
                    <div class="col-sm-9">
                        <g:select class="form-control" name="district" id="district"
                                  from="${districtList}"
                                  valueMessagePrefix="status" optionKey="zoneNumber" optionValue="name"
                                  value="${params?.district}"
                                  noSelection="${["-1": '请选择行政区']}"/>
                    </div>
                </div>
                <div class="form-group col-sm-3">
                    <label class="col-sm-3 control-label">开发商名称</label>
                    <div class="col-sm-9">
                        <input type="text" class="form-control" name="name" id="name" value="${params?.name}" placeholder="请输入开发商名称">
                    </div>
                </div>
            </div>
            </div>
        </g:form>
    </div>
    </div>

    <div class="row">
        <div class="hpanel hgreen">
            <div class="panel-heading">
                <div class="panel-tools">
                    <a class="showhide"><i class="fa fa-chevron-up"></i></a>
                </div>
                全部项目风险预警列表
            </div>
            <div class="panel-body no-padding">
                <div class="table-responsive">
                    <table cellpadding="1" cellspacing="1" class="table table-striped table-bordered table-hover text-center" id="estateTable">
                        <thead>
                        <tr>
                            <g:sortableColumn property="name" title="开发商名称"  class=" text-center" params="${params}"/>
                            <g:sortableColumn property="unitNature" title="项目名称"  class=" text-center" params="${params}"/>
                            <g:sortableColumn property="fullName" title="小区名称"  class=" text-center" params="${params}"/>
                            <g:sortableColumn property="status" title="城市"   class="text-center tdColor" params="${params}"/>
                            <g:sortableColumn property="operatingState" title="行政区" class=" text-center tdColor" params="${params}"/>
                            <g:sortableColumn property="registeredCapital" title="预售证" class=" text-center tdColor" params="${params}"/>
                            <g:sortableColumn property="currency" title="房产类型" class=" text-center tdColor" params="${params}"/>
                            <g:sortableColumn property="scale" title="项目地址" class=" text-center tdColor" params="${params}"/>
                            <g:sortableColumn property="qualificationGrade" title="项目状态" class=" text-center tdColor" params="${params}"/>
                            <g:sortableColumn property="creditRating" title="交房时间" class=" text-center tdColor" params="${params}"/>
                            <g:sortableColumn property="stage" title="已售套数" class=" text-center tdColor" params="${params}"/>
                            <g:sortableColumn property="stage" title="未售套数" class=" text-center tdColor" params="${params}"/>
                            <g:sortableColumn property="stage" title="是否结清贷款" class=" text-center tdColor" params="${params}"/>
                            <g:sortableColumn property="stage" title="入围状态" class=" text-center tdColor" params="${params}"/>
                            <g:sortableColumn property="workflow" title="工作流" class=" text-center tdColor" params="${params}"/>
                        </tr>
                        </thead>
                        <tbody>
                        <tr>
                            <td>碧桂园集团</td>
                            <td>碧桂园二期</td>
                            <td>xx小区</td>
                            <td>北京</td>
                            <td>朝阳区</td>
                            <td>京房置售（2017）100号</td>
                            <td>住宅</td>
                            <td>xx朝阳区xx号</td>
                            <td>告罄</td>
                            <td>2018-10-10</td>
                            <td>2341</td>
                            <td>531</td>
                            <td>未结清</td>
                            <td>已入围</td>
                            <td>催收流程</td>
                        </tr>
                        <tr>
                            <td>绿地A集团</td>
                            <td>xx项目</td>
                            <td>xx小区</td>
                            <td>北京</td>
                            <td>朝阳区</td>
                            <td>京房置售（2017）100号</td>
                            <td>住宅</td>
                            <td>xx朝阳区xx号</td>
                            <td>告罄</td>
                            <td>2018-10-10</td>
                            <td>2341</td>
                            <td>0</td>
                            <td>未结清</td>
                            <td>已入围</td>
                            <td>催收流程</td>
                        </tr>
                        </tbody>
                    </table>
                </div>
            </div>
            <div class="panel-footer">
                <div class="pagination">
                    <g:paginate action="riskWarningAccountProject" total="${riskWarningCount ?: 0}" params="${params}"/>
                </div>
            </div>
        </div>
    </div>

</div>

<script>
    $(function () {
        var flag;
        $("#city").bind("change", function(){
            if('${params.district}'== $("#district option:selected").val()&&flag!=true && '${params.district}' != '-1'){
                flag=true
                return
            }
            $("#district option").remove();
            $("#s2id_district span:first").html("请选择行政区");
            var city = $("#city").val()
            $("#district").append("<option value='-1' >请选择行政区</option>")
            if(city=='-1'){
                return
            }
            $.ajax({
                url: "/estate/districtList",
                type: "POST",
                data: {'city': city} ,
                success: function(result){
                    for(var i=0; i < result.districtList.length; i++){
                        $("#district").append("<option value=" + result.districtList[i].zoneNumber + ">" + result.districtList[i].name + "</option>")
                    }
                }
            });
        });
        $("#city").change();

        //重置按钮
        $("#resetBtn").click(function () {
            $("#name").val("");
            $("#s2id_city span:first").html("请选择城市");
            $("#city").val("");
            $("#s2id_district span:first").html("请选择行政区");
            $("#district").val("");
        });
    });
</script>
</body>
</html>
